﻿using BitButterCORE.Factory;

namespace BitButterCORE.Object
{
	public enum LogType
	{
		INFORMATION,
		WARNING,
		ERROR,
	}

	public class LogEntry : BaseObject
	{
		public LogEntry(LogType logType, string category, string sourceType, uint sourceID, string message)
		{
			LogType = logType;
			Category = category;
			SourceType = sourceType;
			SourceID = sourceID;
			Message = message;
		}

		public LogType LogType { get; }

		public string Category { get; }

		public string SourceType { get; }

		public uint SourceID { get; }

		public string Message { get; }

		protected override IFactory Factory => LogEntryFactory.Instance;

		protected override IObjectReference<BaseObject> CreateReference() => new LogEntryReference(this);
	}

	public class LogEntryReference : ObjectReference<LogEntry>
	{
		public LogEntryReference(LogEntry logEntry)
			: base(LogEntryFactory.Instance, logEntry.ID)
		{
		}
	}
}
